package com.example.demo.service.impl;

import com.example.demo.service.TokenBlacklistService;
import org.springframework.stereotype.Service;

import java.util.concurrent.ConcurrentHashMap;

@Service
public class TokenBlacklistServiceImpl implements TokenBlacklistService {
    private final ConcurrentHashMap<String, Long> blacklist = new ConcurrentHashMap<>();

    @Override
    public void addToBlacklist(String token) {
        blacklist.put(token, System.currentTimeMillis());
    }

    @Override
    public boolean isBlacklisted(String token) {
        return blacklist.containsKey(token);
    }
} 